<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center releaseSale_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub releaseSale_fd0_0'>
          <view class='flex flex-wrap align-center releaseSale_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  releaseSale_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='releaseSale_fd0_0_c1_c0'>发布{{type==1 ? '出售' : '求购'}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end releaseSale_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!--求购品类开始 -->
      <benben-picker ref="benbenWritePickerCodepicker1" :visible.sync="pickerDiy1706625508467" mode='linkage'
        :value.sync="pingid" :label.sync="pingName" :options.sync='pinzhongList' :mask-show='true' :timeout='true'
        :picker-height='88' :level='3' default-type='value'
        :default-props='{"label":"mingcheng","value":"aid","children":"children"}'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between releaseSale_picker1_0'>
            <text class='releaseSale_picker1_0_c0' @tap="$refs.benbenWritePickerCodepicker1.cancel()">取消</text>
            <text>选择品种</text>
            <text class='releaseSale_picker1_0_c2' @tap="$refs.benbenWritePickerCodepicker1.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
      <!--求购品类结束 -->
      <!--选择地区开始 -->
      <benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1706714243244" :label.sync='region'
        mode='region' :mask-show='true' :picker-height='88' :hide-area='true'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between releaseSale_picker2_0'>
            <text class='releaseSale_picker2_0_c0' @tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
            <text>选择所在地区</text>
            <text class='releaseSale_picker2_0_c2' @tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
      <!--选择地区结束 -->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout releaseSale_flex_3">
        <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_0'>
          <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'
            @tap.stop="pickerDiy1706625508467=true">
            <text class='releaseSale_fd3_0_c0_c0'>{{type==1 ? '出售' : '求购'}}品类</text>
            <benben-input class='releaseSale_fd3_0_c0_c1' type="text" :placeholder="`请选择品类`" confirm-type="done"
              disabled :maxlength="-1" placeholder-style="color:#999;font-size:32rpx" v-model="pingName" />
          </view>
          <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
            <text class='releaseSale_fd3_0_c0_c0'>联系方式</text>
            <benben-input class='releaseSale_fd3_0_c0_c1' type="number" :placeholder="`请填写联系方式`" confirm-type="done"
              :disabled="true" :maxlength="11" placeholder-style="color:#999;font-size:32rpx" v-model="phone" />
          </view>
          <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'
            @tap.stop="pickerDiy1706714243244=true">
            <text class='releaseSale_fd3_0_c0_c0'>{{type==1 ? '所在地区' : '求购地区'}}</text>
            <view class='flex flex-wrap align-center justify-end flex-sub'>
              <benben-input class='flex-sub releaseSale_fd3_0_c0_c1' type="text" :placeholder="`请选择所在地区`" disabled
                confirm-type="done" :maxlength="-1" placeholder-style="color:#999;font-size:32rpx" v-model="region" />
              <image class='releaseSale_fd3_0_c2_c1_c1' mode="aspectFit" :src='STATIC_URL+"12.png"'></image>
            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_0_c3'>
            <view class='flex flex-wrap align-center justify-between'>
              <text class='releaseSale_fd3_0_c0_c0'>装车价格</text>
              <view class='flex flex-wrap align-center'>
                <input :maxlength="11" type="number" style="text-align: right;" class="releaseSale_fd3_0_c3_c0_c1_c0"
                  @input="editPrice" placeholder="请填写装车价格" v-model="zhuangchejiage" />
                <!-- <text class='releaseSale_fd3_0_c3_c0_c1_c0'>1.558</text> -->
                <text class='releaseSale_fd3_0_c3_c0_c1_c0'>元/斤</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center releaseSale_fd3_0_c3_c1'>
              <benben-flex-switch-new @change="changePrice" class-name='flex flex releaseSale_fd3_0_c3_c1_c0'
                v-model="exchange" :disabled='false' :auto='true'>
                <template v-slot:checked>

                  <view class='flex flex position-relative align-center'>
                    <image class='releaseSale_checkfd3_0_c3_c1_c0_c0_c0' mode="aspectFill" :src='STATIC_URL+"26.png"'>
                    </image>
                  </view>

                </template>
                <template v-slot:unchecked>

                  <view class='flex flex position-relative justify-end align-center'>
                    <image class='releaseSale_noCheckfd3_0_c3_c1_c0_c1_c0' mode="aspectFill"
                      :src='STATIC_URL+"176.png"'>
                    </image>
                  </view>

                </template>
              </benben-flex-switch-new>
              <text class='releaseSale_fd3_0_c3_c1_c1'>价格电话沟通</text>
            </view>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1'>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
              <view class='flex flex-wrap align-center'>
                <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text>
                <text class='releaseSale_fd3_0_c0_c0'>数量</text>
              </view>
              <view class="flex">
                <input type="number" style="text-align: right" placeholder-class="releaseSale_fd3_1_c0_c0_c1"
                  maxlength="6" class="text-333" placeholder="请填写真实数据" v-model="number_name" @input="chamngeNum" />
                <text class="margin-left-sm">吨</text>
              </view>

              <!-- <text class='releaseSale_fd3_1_c0_c0_c1'>{{number_name}}</text> -->
            </view>
            <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1_c0_c1'>
              <benben-select-diy ref="showSelectPopup1706603379543"
                class-name='flex flex-wrap align-center justify-between flex' :items.sync="numberType"
                v-model="number_id" default-type="aid" default-label="mingcheng" :allow-cancel='false' type="radio"
                :label.sync="number_name" :disabled='false'>
                <template v-for='(item,key0) in numberType'>
                  <view v-if="item.isSelected"
                    class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup1706603379543.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c0_c0'>{{item.mingcheng}}吨</text>
                  </view>
                  <view v-else class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup1706603379543.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c1_c0'>{{item.mingcheng}}吨</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
              <view class='flex flex-wrap align-center'>
                <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text>
                <text class='releaseSale_fd3_0_c0_c0'>水分</text>
              </view>
              <view class="flex align-center">
                <input type="number" style="text-align: right" placeholder-class="releaseSale_fd3_1_c0_c0_c1"
                  maxlength="4" class="text-333" placeholder="请填写" v-model="moisture_name" @input="chamngeMois" />
                <text class="margin-left-sm">%</text>
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1_c0_c1'>
              <benben-select-diy ref="showSelectPopup1706604061680"
                class-name='flex flex-wrap align-center justify-between flex' :items.sync="moistureType"
                v-model="moisture_id" default-type="aid" default-label="mingcheng" :allow-cancel='false' type="radio"
                :label.sync="moisture_name" :disabled='false'>
                <template v-for='(item,key0) in moistureType'>
                  <view v-if="item.isSelected"
                    class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup1706604061680.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c0_c0'>{{item.mingcheng}}%</text>
                  </view>
                  <view v-else class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup1706604061680.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c1_c0'>{{item.mingcheng}}%</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
              <view class='flex flex-wrap align-center'>
                <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text>
                <text class='releaseSale_fd3_0_c0_c0'>容重</text>
              </view>
              <view class="flex align-center">
                <input type="number" style="text-align: right" placeholder-class="releaseSale_fd3_1_c0_c0_c1"
                  maxlength="4" class="text-333" placeholder="请填写" v-model="capacity_name" @input="chamngecapacity" />
                <text class="margin-left-sm">g/L</text>
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1_c0_c1'>
              <benben-select-diy ref="showSelectPopup1706603728980"
                class-name='flex flex-wrap align-center justify-between flex' :items.sync="capacityType"
                v-model="capacity_id" default-type="aid" default-label="mingcheng" :allow-cancel='false' type="radio"
                :label.sync="capacity_name" :disabled='false'>
                <template v-for='(item,key0) in capacityType'>
                  <view v-if="item.isSelected"
                    class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup1706603728980.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c0_c0'>{{item.mingcheng}}g/L</text>
                  </view>
                  <view v-else class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup1706603728980.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c1_c0'>{{item.mingcheng}}g/L</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
              <view class='flex flex-wrap align-center'>
                <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text>
                <text class='releaseSale_fd3_0_c0_c0'>净毛</text>
              </view>
              <view class="releaseSale_fd3_0_c3_c0_c1_c0">
                {{clean_name || '请选择'}}
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1_c0_c1'>
              <benben-select-diy ref="showSelectPopup1706603970735" class-name='flex flex-wrap align-center  flex'
                :items.sync="cleanType" :label.sync="clean_name" v-model="clean_id" default-type="aid"
                default-label="mingcheng" :allow-cancel='false' type="radio" :disabled='false'>
                <template v-for='(item,key0) in cleanType'>
                  <view v-if="item.isSelected"
                    class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup1706603970735.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c0_c0'>{{item.mingcheng}}</text>
                  </view>
                  <view v-else class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup1706603970735.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c1_c0'>{{item.mingcheng}}</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch' v-if="type==2">
            <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'>
              <view class='flex flex-wrap align-center'>
                <!-- <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text> -->
                <text class='releaseSale_fd3_0_c0_c0'>其他</text>
              </view>
              <view class="releaseSale_fd3_0_c3_c0_c1_c0">
                {{qita_name || '请选择'}}
              </view>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd3_1_c0_c1'>
              <benben-select-diy ref="showSelectPopup17066039707353" class-name='flex flex-wrap align-center  flex'
                :items.sync="buyqitalist" :label.sync="qita_name" v-model="qita_id" default-type="aid"
                default-label="mingcheng" :allow-cancel='true' type="checkbox" :disabled='false'>
                <template v-for='(item,key0) in buyqitalist'>
                  <view v-if="item.isSelected"
                    class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup17066039707353.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c0_c0'>{{item.mingcheng}}</text>
                  </view>
                  <view v-else class='flex align-center justify-center flex releaseSale_fd3_1_c0_c1_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup17066039707353.tapHandle(key0)">
                    <text class='releaseSale_fd3_1_c0_c1_c0_c1_c0'>{{item.mingcheng}}</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <view class='flex flex-wrap align-center justify-between releaseSale_fd3_0_c0'
            @click.stop="pickerDiy1704874166629=true">
            <view class='flex flex-wrap align-center'>
              <!-- <text class='releaseSale_fd3_1_c0_c0_c0_c0'>*</text>songliangren -->
              <text class='releaseSale_fd3_0_c0_c0'>年份</text>
            </view>
            <view class='flex flex-wrap align-center justify-end flex-sub'>
              <view class="flex-sub releaseSale_fd3_0_c0_c1">
                {{year || '请选择年份'}}
              </view>
              <!-- <benben-input class='flex-sub releaseSale_fd3_0_c0_c1' type="text" :placeholder="`请选择年份`"
                confirm-type="done" :maxlength="-1" disabled placeholder-style="color:#999;font-size:32rpx"
                v-model="year" /> -->
              <image class='releaseSale_fd3_0_c2_c1_c1' mode="aspectFit" :src='STATIC_URL+"133.png"'></image>
            </view>
          </view>
          <view class='flex flex-wrap align-center releaseSale_fd3_1_c5'>
            <text class='releaseSale_fd3_0_c0_c0'>备注</text>
            <view class='flex flex-wrap releaseSale_fd3_1_c5_c1'>
              <textarea class='flex releaseSale_input_fd3_1_c5_c1' :placeholder="'请填写备注'" :maxlength="50"
                placeholder-style="color:#999;font-size:28rpx" v-model="rember" />

            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-start releaseSale_fd3_1_c5' v-if="type==1">
            <view class='flex flex-wrap align-center'>
              <text class='releaseSale_fd3_1_c6_c0_c0'>图片</text>
              <text class='releaseSale_fd3_1_c6_c0_c1'>请上传图片</text>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch'>
              <benben-images-upload ref="benbenImagesUploadfd1_0_c4_c0" :maxlength="6" :img-list.sync="img"
                :img-ids.sync="img_id" :is-show-tips='true'>
                <template #content="{ num, maxlength, isShow, imgList }">
                  <view class="flex flex-wrap align-start flex feedBack_fd1_0_c4_c0">

                    <view v-for="(image, index) in imgList" :key="index"
                      class='flex position-relative feedBack_fd1_0_c4_c00'>
                      <text class='fu-iconfont2 position-absolute feedBack_fd1_0_c4_c000'
                        @tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.delImage(index)">&#xE8E7;</text>
                      <image class='feedBack_fd1_0_c4_c001'
                        @tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.previewImage(index)" mode="aspectFit"
                        :src='image'>
                      </image>
                    </view>

                    <image class='feedBack_fd1_0_c4_c01'
                      @tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.manyChooseImage()" v-if="isShow" mode="aspectFit"
                      :src='STATIC_URL+"25.png"'></image>

                  </view>
                </template>
              </benben-images-upload>
            </view>
            <!-- <view class="upload position-relative releaseSale_fd3_1_c6_c1">


            </view> -->
          </view>
        </view>
        <view class='flex flex-wrap align-center'>
          <button class='releaseSale_fd3_2_c0' @tap.stop="submit">立即发布</button>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1706715717630" :mask="true" :mask-close-able="true" mode='bottom' :z-index='999'>
        <!---flex布局flex布局开始-->
        <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout releaseSale_flex_4">
          <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd4_0'>
            <view class='flex flex-wrap align-center justify-between releaseSale_fd4_0_c0'>
              <view class='flex flex-wrap align-center releaseSale_fd4_0_c0_c0'>
              </view>
              <view class='flex flex-wrap align-center'>
                <image class='releaseSale_fd4_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"21.png"'></image>
                <text class='releaseSale_fd4_0_c0_c1_c1'>分享到</text>
                <image class='releaseSale_fd4_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"22.png"'></image>
              </view>
              <image class='releaseSale_fd4_0_c0_c2' mode="aspectFit" :src='STATIC_URL+"83.png"'
                @tap.stop="popupShow1706715717630=false"></image>
            </view>
            <view class='flex flex-wrap align-center justify-around releaseSale_fd4_0_c1'>
              <view class='flex flex-direction flex-wrap align-center' @click.stop="shareApp('1')">
                <image class='releaseSale_fd4_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"23.png"'></image>
                <text class='releaseSale_fd4_0_c1_c0_c1'>微信好友</text>
              </view>
              <view class='flex flex-direction flex-wrap align-center' @click.stop="shareApp('2')">
                <image class='releaseSale_fd4_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"84.png"'></image>
                <text class='releaseSale_fd4_0_c1_c0_c1'>朋友圈</text>
              </view>
            </view>
          </view>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>
      <benben-popup v-model="popupShow1706714716985" :mask="true" :mask-close-able="false" mode='center' :z-index='999'>
        <!---flex布局flex布局开始-->
        <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout releaseSale_flex_5">
          <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd5_0'>
            <view class='flex flex-wrap align-center justify-center'>
              <text class='releaseSale_fd5_0_c0_c0'>发布成功!</text>
            </view>
            <view class='flex flex-wrap align-center justify-center releaseSale_fd5_0_c1'>
              <text class='releaseSale_fd5_0_c1_c0'>立即分享，预计可提高30%的成交率</text>
            </view>
            <view class='flex flex-wrap align-center justify-center releaseSale_fd5_0_c2'>
              <button class='releaseSale_fd5_0_c2_c1' @tap.stop="shareNowFunc()">立即分享</button>
              <button class='releaseSale_fd5_0_c2_c0 ' @tap.stop="handleJumpDiy" data-type="redirectTo"
                :data-url="`/pages/fabu/successfullyPurchase/successfullyPurchase?type=${type}&aid=${successaid}`">查看详情</button>
            </view>
          </view>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>

      <benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1704874166629" mode='date'
        :picker-height='88' :current='true' :mask-show='true' fields='year' :timeout='true' start-year='1990-01-01'
        end-year='现在' from-data='' :value.sync='year'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between myProfile_picker4_0'>
            <text class='myProfile_picker4_0_c0' @tap="$refs.benbenWritePickerCodepicker4.cancel()">取消</text>
            <text>选择时间</text>
            <text class='myProfile_picker4_0_c2' @tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
    </view>
  </view>
</template>
<script>
  import UploadImage from '@/common/utils/upload-image.js'
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        pickerDiy1704874166629: false,
        "popupShow1706714716985": false,
        "popupShow1706715717630": false,
        "pickerDiy1706714243244": false,
        "pickerDiy1706625508467": false,
        "category": "",
        "phone": "",
        "region": "",
        "price": "",
        "exchange": false,
        "numberType": [],
        "number_id": "",
        "year": "",
        "rember": "",
        "moistureType": [],
        "moisture_id": "",
        "capacityType": [],
        "capacity_id": "",
        "cleanType": [],
        "clean_id": "",
        "otherType": [{
          "name": "装车付款",
          "value": "1",
          "image": ""
        }, {
          "name": "上门看货",
          "value": "2",
          "image": ""
        }, {
          "name": "马上派车",
          "value": "3",
          "image": ""
        }, {
          "name": "长期要货",
          "value": "4",
          "image": ""
        }],
        "other_id": "",
        "image": "",
        clean_name: '',
        number_name: '',
        moisture_name: '',
        capacity_name: '',
        "img": [],
        "img_id": "",
        pinzhongList: [],
        pingid: '',
        pingName: '',
        zhuangchejiage: '',
        type: '',
        buyqitalist: [],
        qita_id: '',
        qita_name: '',
        successaid: '',
        infodetail: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      var timeStamp = new Date();
      this.year = this.$util.timeFormat(timeStamp, 'yyyy')
      console.log('nianfe', this.nianfen)
      this.type = options.type

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getData()
      if (this.isLogin) {
        this.getInfo()
      }
    },
    onHide() {
      this.pickerDiy1704874166629 = false
      this.popupShow1706714716985 = false
      this.popupShow1706715717630 = false
      this.pickerDiy1706714243244 = false
      this.pickerDiy1706625508467 = false
    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      editPrice() {
        this.exchange = false
      },
      changePrice() {
        if (this.exchange) {
          this.zhuangchejiage = ''
        }
      },
      getInfo() {
        this.$api.post(global.apiUrls.post5c78c4772da97).then(res => {
          if (res.data.code == 1) {
            this.phone = res.data.data._mobile
            this.region = res.data.data.address
          }
        })
      },
      shareApp(type) {
        let that = this
        let provider = ''
        let scene = ''
        if (type == 1) {
          provider = 'weixin'
          scene = 'WXSceneSession'
        } else if (type == 2) {
          provider = 'weixin'
          scene = 'WXSenceTimeline'
        }
        // let links = that.apartmentDetails.h5_share +
        //   `/pages/shouye/apartmentDetails/apartmentDetails?id=${that.apartmentDetails.aid}`
        // console.log(' that.apartmentDetails', links)
        uni.share({
          provider: provider,
          scene: scene,
          imageUrl: that.infodetail.share_img,
          title: that.infodetail.title,
          summary: that.infodetail.share_text,
          href: that.infodetail.h5_share,
          success: function(res) {
            that.shareApp1()
            console.log('22222')
            console.log("success:" + JSON.stringify(res));
          },
          fail: function(err) {
            console.log("fail:" + JSON.stringify(err));
          }
        });
      },
      shareApp1() {
        console.log('pppppppp')
        this.$api.post(global.apiUrls.post6614f414e5638, {
          buy_id: this.aid,
          user_id: this.userInfo ? this.userInfo.id : ''
        }).then(res => {
          if (res.data.code == 1) {
            this.getData()
          }
        })
      },
      chamngeNum() {
        if (parseFloat(this.number_name) > 100000) {
          this.number_name = ''
          this.$message.info('请正确填写数量，不得超过10万吨')
        }
        this.number_id = ''
      },
      chamngeMois() {
        if (parseFloat(this.moisture_name) > 1000) {
          this.moisture_name = ''
          this.$message.info('请正确填写水分，不得超过1000')
        }
        this.moisture_id = ''
      },
      chamngecapacity() {
        if (parseFloat(this.capacity_name) > 1000) {
          this.capacity_name = ''
          this.$message.info('请正确填写容重，不得超过1000')
        }
        this.capacity_id = ''
      },
      getData() {
        this.$api.post(global.apiUrls.post656ee500b728a).then(res => { //查询品类类别列表
          if (res.data.code == 1) {
            this.pinzhongList = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post656ee5ddb0868).then(res => { //查询数量列表
          if (res.data.code == 1) {
            this.numberType = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post656ee66d43955).then(res => { //查询水分列表
          if (res.data.code == 1) {
            this.moistureType = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post656ee7641c07b).then(res => { //查询容量列表
          if (res.data.code == 1) {
            this.capacityType = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post656ee7a781a4f).then(res => { //查询杂质列表
          if (res.data.code == 1) {
            this.cleanType = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post656ee806bb95d).then(res => { //查询其他列表
          if (res.data.code == 1) {
            this.buyqitalist = res.data.data
          }
        })
      },
      submit() {
        if (!this.pingName) {
          this.$message.info('请选择品类')
          return
        }
        if (!this.phone) {
          this.$message.info('请填写联系方式')
          return
        }
        if (!validate(this.phone, 'phone')) {
          this.$message.info('请输入正确的手机号');
          return false;
        }
        if (!this.region) {
          this.$message.info('请选择所在地区')
          return
        }

        if (!this.number_name) {
          this.$message.info('请输入数量')
          return
        }
        if (!this.moisture_name) {
          this.$message.info('请输入水分')
          return
        }
        if (!this.capacity_name) {
          this.$message.info('请输入容重')
          return
        }
        // if (!this.year) {
        //   this.$message.info('请选择年份')
        //   return
        // }
        if (!this.clean_name) {
          this.$message.info('请选择净毛')
          return
        }
        if (this.type == 2) {
          // if (!this.qita_name) {
          //   this.$message.info('请选择其他')
          //   return
          // }
        }
        if (this.exchange) {
          this.zhuangchejiage = '-1'
        } else {
          if (!this.zhuangchejiage) {
            this.$message.info('请填写装车价格')
            return
          }
        }
        let images = ''
        if (this.img.length) {
          images = this.img.join(',')
        }
        let pinIds = this.pingid.split(',')[2]
        console.log('this.pingid', pinIds)
        // exchange
        this.$api.post(global.apiUrls.post656ef0db43a71, {
          fenlei: this.type,
          rongliang: this.capacity_name, //容重
          shuifen: this.moisture_name, //水分
          lianxifangshi: this.phone,
          tupian: images,
          nianfen: this.year,
          suozaidi: this.region,
          zhuangchejiage: this.zhuangchejiage,
          shuliang: this.number_name,
          beizhu: this.rember, //出售输入
          buycate_id: pinIds,
          // qitabiaoqian: '',
          buyshuifen_id: this.moisture_id,
          buyrongliang_id: this.capacity_id,
          buyzazhi_id: this.clean_id,
          buyqita_id: this.qita_id
        }).then(res => {
          if (res.data.code == 1) {
            // this.infodetail = res.data.data
            this.successaid = res.data.data.aid
            this.getDetail()
            this.phone = ''
            this.year = ''
            this.pingName = ''
            this.img = []
            this.pingid = []
            this.region = ''
            this.zhuangchejiage = ''
            this.number_name = ''
            this.rember = ''
            this.pingid = ''
            this.capacity_id = ''
            this.moisture_id = ''
            this.clean_id = ''
            this.qita_id = ''
            this.popupShow1706714716985 = true
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      getDetail() {
        this.$api.post(global.apiUrls.post656ef5107cf32, {
          aid: this.successaid,

        }).then(res => {
          if (res.data.code == 1) {
            this.infodetail = res.data.data
          }
        })
      },
      //立即分享
      shareNowFunc() {
        this.popupShow1706714716985 = false;
        this.popupShow1706715717630 = true;
      }
    }
  };
</script>
<style lang="scss" scoped>
  .feedBack_fd1_0_c4_c01 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c4_c001 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c4_c000 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .feedBack_fd1_0_c4_c00 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .feedBack_fd1_0_c4_c0 {
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .myProfile_picker4_0_c2 {
    color: rgba(100, 80, 235, 1);
  }

  .myProfile_picker4_0_c0 {
    color: var(--benbenFontColor2);
  }

  .myProfile_picker4_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 250, 1);
    background-size: 100% auto;
  }

  .releaseSale_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .releaseSale_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .releaseSale_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .releaseSale_fd0_0_c0 {
    width: 120rpx;
  }

  .releaseSale_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .releaseSale_picker1_0_c2 {
    color: rgba(37, 104, 174, 1);
  }

  .releaseSale_picker1_0_c0 {
    color: rgba(153, 153, 153, 1);
  }

  .releaseSale_picker1_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .releaseSale_picker2_0_c2 {
    color: rgba(37, 104, 174, 1);
  }

  .releaseSale_picker2_0_c0 {
    color: rgba(191, 191, 191, 1);
  }

  .releaseSale_picker2_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .releaseSale_flex_3 {
    padding: 24rpx 30rpx 40rpx 30rpx;
  }

  .releaseSale_fd3_2_c0 {
    background: rgba(37, 104, 174, 1);
    border-radius: 100rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 34rpx;
    color: #fff;
  }

  .releaseSale_fd3_1_c6_c1_image {
    width: 200rpx;
    height: 200rpx;
  }

  .releaseSale_fd3_1_c6_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_1_c6_c0_c1 {
    color: #BFBFBF;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .releaseSale_fd3_1_c6_c0_c0 {
    color: #666666;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .releaseSale_input_fd3_1_c5_c1 {
    width: 100%;
    height: 100rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .releaseSale_fd3_1_c5_c1 {
    background: rgba(248, 248, 250, 1);
    width: 630rpx;
    border-radius: 16rpx;
    padding: 32rpx 20rpx 032rpx 20rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_1_c5 {
    margin: 40rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_1_c0_c1_c0_c1_c0 {
    color: #101010;
    font-size: 30rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .releaseSale_fd3_1_c0_c1_c0_c1 {
    background: rgba(255, 255, 255, 1);
    width: 131rpx;
    height: 72rpx;
    border-radius: 12rpx;
    margin-top: 10rpx;
    margin-left: 10rpx;
    background-size: 100% auto;
  }

  .releaseSale_fd3_1_c0_c1_c0_c0_c0 {
    color: #FFFFFF;
    font-size: 30rpx;
    font-weight: 700;
    line-height: 30rpx;
  }

  .releaseSale_fd3_1_c0_c1_c0_c0 {
    background: rgba(37, 104, 174, 1);
    width: 131rpx;
    height: 72rpx;
    border-radius: 12rpx;
    margin-top: 10rpx;
    margin-left: 10rpx;
    background-size: 100% auto;
  }

  .releaseSale_fd3_1_c0_c1 {
    background: rgba(248, 248, 250, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_1_c0_c0_c1 {
    color: #BFBFBF;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .releaseSale_fd3_1_c0_c0_c0_c0 {
    color: var(--benbenFontColor5);
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .releaseSale_fd3_1 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 0rpx 24rpx 40rpx 24rpx;
  }

  .releaseSale_fd3_0_c3_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .releaseSale_noCheckfd3_0_c3_c1_c0_c1_c0 {
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    width: 32rpx;
    height: 32rpx;
  }

  .releaseSale_checkfd3_0_c3_c1_c0_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 24rpx 24rpx 24rpx 24rpx;
  }

  ::v-deep .releaseSale_fd3_0_c3_c1_c0 {
    margin: 0rpx 15rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_0_c3_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd3_0_c3_c0_c1_c0 {
    color: #101010;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .releaseSale_fd3_0_c3 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .releaseSale_fd3_0_c2_c1_c1 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx 14rpx;
  }

  .releaseSale_fd3_0_c0_c1 {
    text-align: right;
    font-size: 32rpx;
    color: rgba(16, 16, 16, 1);
  }

  .releaseSale_fd3_0_c0_c0 {
    color: #666666;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .releaseSale_fd3_0_c0 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .releaseSale_fd3_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .releaseSale_flex_4 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx 40rpx 0rpx 0rpx;
    background-size: 100% auto;
  }

  .releaseSale_fd4_0_c1_c0_c1 {
    color: #333333;
    margin: 16rpx 0rpx 0rpx 0rpx;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c1_c0_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c1 {
    margin: 50rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c2 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c1_c1 {
    margin: 0rpx 20rpx 0rpx 20rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c0_c1_c0 {
    width: 28rpx;
    height: 10rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .releaseSale_fd4_0_c0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .releaseSale_fd4_0 {
    padding: 40rpx 0rpx 56rpx 0rpx;
  }

  .releaseSale_flex_5 {
    background: rgba(255, 255, 255, 1);
    width: 540rpx;
    background-size: 100% auto;
    border-radius: 16rpx;
  }

  .releaseSale_fd5_0_c2_c1 {
    background: rgba(37, 104, 174, 1);
    border-radius: 100rpx;
    width: 209rpx;
    line-height: 80rpx;
    font-size: 34rpx;
    color: #fff;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .releaseSale_fd5_0_c2_c0 {
    border: 1px solid rgba(37, 104, 174, 1);
    background: rgba(255, 255, 255, 1);
    border-radius: 100rpx;
    width: 209rpx;
    line-height: 80rpx;
    font-size: 34rpx;
    color: rgba(37, 104, 174, 1);
    margin: 0rpx 0rpx 0rpx 20rpx;
  }

  .releaseSale_fd5_0_c2 {
    margin: 82rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd5_0_c1_c0 {
    color: #333333;
    font-size: 30rpx;
    font-weight: 400;
    line-height: 52rpx;
    text-align: center;
  }

  .releaseSale_fd5_0_c1 {
    margin: 22rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd5_0_c0_c0 {
    color: #101010;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .releaseSale_fd5_0 {
    padding: 40rpx 0rpx 40rpx 0rpx;
  }
</style>
